Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build][Bugfix] Use CMAKE_ prefix for <LANG>_COMPILER_LAUNCHER #13697

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

Lunderberg
Copy link
Contributor

@Lunderberg Lunderberg commented Jan 4, 2023

Previously, when using set(USE_CCACHE AUTO), the cmake config would set variables CXX_COMPILER_LAUNCHER and C_COMPILER_LAUNCHER. While there are the target-specific properties named <LANG>_COMPILER_LAUNCHER, cmake doesn't check for their use as global variables.

This commit updates the build file to instead set the CMAKE_<LANG>_COMPILER_LAUNCHER variables, which are used as the default for the <LANG>_COMPILER_LAUNCHER property.

Previously, when using `set(USE_CCACHE AUTO)`, the cmake config would
set variables `CXX_COMPILER_LAUNCHER` and `C_COMPILER_LAUNCHER`.
While there are the target-specific properties named
[`<LANG>_COMPILER_LAUNCHER`](https://cmake.org/cmake/help/latest/prop_tgt/LANG_COMPILER_LAUNCHER.html),
cmake doesn't check for their use as global variables.

This commit updates the build file to instead set the
[`CMAKE_<LANG>_COMPILER_LAUNCHER`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_LAUNCHER.html)
variables, which are used as the default for the
`<LANG>_COMPILER_LAUNCHER` property.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Jan 4, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: build, bugfix See #10317 for details

Generated by tvm-bot

1 similar comment
@tvm-bot
Copy link
Collaborator

tvm-bot commented Jan 4, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: build, bugfix See #10317 for details

Generated by tvm-bot

@Lunderberg
Copy link
Contributor Author

@tkonolige This is a follow-up to #12839. I noticed that ccache wasn't being used in my dev environment, and it looks like there was a different variable to be used.

Copy link
Contributor

@tkonolige tkonolige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my reading of the cmake documentation it seems like CXX_COMPILER_LAUNCHER should work. But using CMAKE_CXX_COMPILER_LAUNCHER should also work, so I'm fine switching to it.

@tkonolige tkonolige merged commit 8088dcb into apache:main Jan 4, 2023
@Lunderberg Lunderberg deleted the cmake_ccache_bugfix branch January 5, 2023 16:17
fzi-peccia pushed a commit to fzi-peccia/tvm that referenced this pull request Mar 27, 2023
…e#13697)

Previously, when using `set(USE_CCACHE AUTO)`, the cmake config would
set variables `CXX_COMPILER_LAUNCHER` and `C_COMPILER_LAUNCHER`.
While there are the target-specific properties named
[`<LANG>_COMPILER_LAUNCHER`](https://cmake.org/cmake/help/latest/prop_tgt/LANG_COMPILER_LAUNCHER.html),
cmake doesn't check for their use as global variables.

This commit updates the build file to instead set the
[`CMAKE_<LANG>_COMPILER_LAUNCHER`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_LAUNCHER.html)
variables, which are used as the default for the
`<LANG>_COMPILER_LAUNCHER` property.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants